package com.sci.web.action.datareportseason;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Enterprise_Project;
import com.sci.web.dao.DataReportM_ProjectDao;

/**
 * 更新企业项目计划
 * 
 * @author BaiFuyou
 * @date: Nov 5, 2011 3:10:05 PM
 */
public class UpdateEnterpriseProject_BaseInfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6548989638906443657L;
	@Resource
	private DataReportM_ProjectDao dataReportM_ProjectDao;
	private int pid;
	private int eid;
	private int project_type;
	private int project_is_major;
	private String project_name;
	private String project_start_time;
	private String project_end_time;
	private String project_government_money;

	/**
	 * @return the pid
	 */
	public int getPid() {
		return pid;
	}

	/**
	 * @param pid
	 *            the pid to set
	 */
	public void setPid(int pid) {
		this.pid = pid;
	}

	/**
	 * @return the eid
	 */
	public int getEid() {
		return eid;
	}

	/**
	 * @param eid
	 *            the eid to set
	 */
	public void setEid(int eid) {
		this.eid = eid;
	}

	/**
	 * @return the project_type
	 */
	public int getProject_type() {
		return project_type;
	}

	/**
	 * @param project_type
	 *            the project_type to set
	 */
	public void setProject_type(int project_type) {
		this.project_type = project_type;
	}

	/**
	 * @return the project_is_major
	 */
	public int getProject_is_major() {
		return project_is_major;
	}

	/**
	 * @param project_is_major
	 *            the project_is_major to set
	 */
	public void setProject_is_major(int project_is_major) {
		this.project_is_major = project_is_major;
	}

	/**
	 * @return the project_name
	 */
	public String getProject_name() {
		return project_name;
	}

	/**
	 * @param project_name
	 *            the project_name to set
	 */
	public void setProject_name(String project_name) {
		this.project_name = project_name;
	}

	/**
	 * @return the project_start_time
	 */
	public String getProject_start_time() {
		return project_start_time;
	}

	/**
	 * @param project_start_time
	 *            the project_start_time to set
	 */
	public void setProject_start_time(String project_start_time) {
		this.project_start_time = project_start_time;
	}

	/**
	 * @return the project_end_time
	 */
	public String getProject_end_time() {
		return project_end_time;
	}

	/**
	 * @param project_end_time
	 *            the project_end_time to set
	 */
	public void setProject_end_time(String project_end_time) {
		this.project_end_time = project_end_time;
	}

	/**
	 * @return the project_government_money
	 */
	public String getProject_government_money() {
		return project_government_money;
	}

	/**
	 * @param project_government_money
	 *            the project_government_money to set
	 */
	public void setProject_government_money(String project_government_money) {
		this.project_government_money = project_government_money;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		Enterprise_Project ep = new Enterprise_Project();
		ep.setEnterprise_id(eid);
		ep.setProject_end_time(project_end_time.trim().substring(0,10));
		ep.setProject_government_money(project_government_money.trim());
		ep.setProject_is_major(project_is_major);
		ep.setProject_name(project_name.trim());
		ep.setProject_start_time(project_start_time.trim().substring(0,10));
		ep.setProject_type(project_type);
		ep.setProject_id(pid);
		if (dataReportM_ProjectDao.updateEnterpriseProject(ep)) {
			super.outPrint("ok");
		} else {
			super.outPrint("fail");
		}
		return "json";
	}

}
